import request from '@/libs/request'

/**
 * 船到模拟测试API服务
 */

// 获取测试配置
export function getChuandaoTestConfig() {
  return request({
    url: '/chuandao/test/index',
    method: 'get'
  })
}

// 执行模拟回调测试
export function simulateCallback(data) {
  return request({
    url: '/chuandao/test/simulateCallback',
    method: 'post',
    data
  })
}

// 批量模拟测试
export function batchSimulateCallback(data) {
  return request({
    url: '/chuandao/test/batchSimulate',
    method: 'post',
    data
  })
}

// 验证回调URL
export function validateCallbackUrl(data) {
  return request({
    url: '/chuandao/test/validateCallbackUrl',
    method: 'post',
    data
  })
}

// 获取订单状态列表
export function getOrderStates() {
  return request({
    url: '/chuandao/test/getOrderStates',
    method: 'get'
  })
}

// 获取测试历史
export function getTestHistory(params) {
  return request({
    url: '/chuandao/test/getTestHistory',
    method: 'get',
    params
  })
}

// 清理测试历史
export function clearTestHistory() {
  return request({
    url: '/chuandao/test/clearTestHistory',
    method: 'post'
  })
}

// 获取测试统计
export function getTestStatistics(params) {
  return request({
    url: '/chuandao/test/getTestStatistics',
    method: 'get',
    params
  })
}

// 获取Token状态
export function getTokenStatus() {
  return request({
    url: '/chuandao/test/tokenStatus',
    method: 'get'
  })
}

// 刷新Token
export function refreshToken() {
  return request({
    url: '/chuandao/test/refreshToken',
    method: 'post'
  })
}

// 获取完整Token（仅测试环境）
export function getFullToken() {
  return request({
    url: '/chuandao/test/getFullToken',
    method: 'get'
  })
}
